inspector: Add a graph cell renderer
authorBenjamin Otte <otte@redhat.com>
Tue, 14 Oct 2014 11:51:09 +0000 (13:51 +0200)
committerBenjamin Otte <otte@redhat.com>
Tue, 14 Oct 2014 12:03:06 +0000 (14:03 +0200)
... and use it to display graphs for how object counts changed.

gtk/inspector/Makefile.am
gtk/inspector/init.c
gtk/inspector/statistics.ui
gtk/inspector/statistics.ui.h

index da016f421f83ceb8745acee35f08f9b2abd22dbd..e12f3e0c79e743bbfbe5eb8bf947e23462fea2ea 100644 (file)
@@ -19,6 +19,8 @@ libgtkinspector_la_SOURCES =          \
        action-editor.c                 \
        actions.h                       \
        actions.c                       \
+       cellrenderergraph.h             \
+       cellrenderergraph.c             \
        classes-list.h                  \
        classes-list.c                  \
        css-editor.h                    \
index 3e523b38378dcaabf7e3237537a9ea0c62012b4a..80b303dc2136e8127d60bc2e7b39c980b0e876ab 100644 (file)
@@ -25,6 +25,7 @@
 #include "init.h"
 
 #include "actions.h"
+#include "cellrenderergraph.h"
 #include "classes-list.h"
 #include "css-editor.h"
 #include "data-list.h"
@@ -51,6 +52,7 @@ gtk_inspector_init (void)
 {
   gtk_inspector_register_resource ();
 
+  g_type_ensure (GTK_TYPE_CELL_RENDERER_GRAPH);
   g_type_ensure (GTK_TYPE_GRAPH_DATA);
   g_type_ensure (GTK_TYPE_INSPECTOR_ACTIONS);
   g_type_ensure (GTK_TYPE_INSPECTOR_CLASSES_LIST);
index 04148cd118c6e07d00726c7a81b7a45087ecf34b..7c4ca20fe60c196b1484ea43f2978447c171a4a9 100644 (file)
                         </child>
                       </object>
                     </child>
+                    <child>
+                      <object class="GtkTreeViewColumn" id="column_self_graph">
+                        <property name="visible">True</property>
+                        <property name="sort-column-id">4</property>
+                        <property name="title" translatable="yes">Self</property>
+                        <child>
+                          <object class="GtkCellRendererGraph" id="renderer_self_graph">
+                            <property name="minimum">0</property>
+                            <property name="xpad">1</property>
+                            <property name="ypad">1</property>
+                          </object>
+                          <attributes>
+                            <attribute name="data">6</attribute>
+                          </attributes>
+                        </child>
+                      </object>
+                    </child>
+                    <child>
+                      <object class="GtkTreeViewColumn" id="column_cumulative_graph">
+                        <property name="visible">True</property>
+                        <property name="sort-column-id">5</property>
+                        <property name="title" translatable="yes">Cumulative</property>
+                        <child>
+                          <object class="GtkCellRendererGraph" id="renderer_cumulative_graph">
+                            <property name="minimum">0</property>
+                            <property name="xpad">1</property>
+                            <property name="ypad">1</property>
+                          </object>
+                          <attributes>
+                            <attribute name="data">7</attribute>
+                          </attributes>
+                        </child>
+                      </object>
+                    </child>
                   </object>
                 </child>
               </object>
index bbb27b36ac713b5cce86754914e13fba2804c6a5..b1fbb465424ec8ab18034e4a56cfcc4322d7df0b 100644 (file)
@@ -4,4 +4,6 @@ N_("Self 1");
 N_("Cumulative 1");
 N_("Self 2");
 N_("Cumulative 2");
+N_("Self");
+N_("Cumulative");
 N_("Enable statistics with GOBJECT_DEBUG=instance-count");